import sys
 
from PyQt5 import QtWidgets, uic
from pyqtui_test import Ui_MainWindow
from datetime import datetime

#  # 测试直接加载解面显示，但是操作无法对应。
# app = QtWidgets.QApplication(sys.argv)
# window = uic.loadUi("pyqtui_test.ui")
# window.show()
# app.exec()


class TestWin(Ui_MainWindow):
    def __init__(self, window):
        super().setupUi(window)
        self.testbtn.clicked.connect(self.testclick)
 
    def testclick(self):
        print(self.testTime.dateTime())

        # 设置为当前时间
        self.testTime.setDateTime(datetime.now())


app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QMainWindow()
ui = TestWin(window)
window.show()
app.exec_()
